<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .inputbox input {
            height: 40px;
            width: 100%;
            outline: none;
            border: 1px solid #ccc;
            padding-left: 20px;
            text-align: center;
        }

        .swiper {
            height: 200px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        .list .good {
            height: 100px;
            border: 1px solid #ccc;
            margin: 10px;
        }

        .tabbar {
            display: flex;
            width: 100%;
            position: fixed;
            bottom: 0;
            justify-content: space-around;
            align-items: center;
            padding: 15px;
            border-top: 1px solid #ccc;
            box-sizing: border-box;
        }
    </style>

</head>

<body>
    <div id="app">
        <div class="box">
            <aa></aa>
            <bb></bb>
            <cc></cc>
            <ee></ee>
        </div>
    </div>
</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    //定义组件
    //对象形式的组件,template的值是组建的标签
    //输入框组件
    var InputBox = {
        template: `<div class="Inputbox">
                        <input type="text" placeholder="输入商品名称">
                    </div>`
    }
    //轮播图组件
    var Swiper = {
        template: `<div class="swiper"></div>`
    }
    // 推荐列表组件
    var List = {
        template: `<div class="list">
                            <div class="good"></div>
                            <div class="good"></div>
                            <div class="good"></div>
                        </div>`
    }
    // 导航栏组件
    var Tabbar = {
        template: `<div class="tabbar">
                            <div class="btn">首页</div>
                            <div class="btn">订单</div>
                            <div class="btn">我的</div>
                        </div>`
    }
    var v = new Vue({
        el: '#app',
        data: {},
        components: {
            'aa': InputBox,
            'bb': Swiper,
            'cc': List,
            'ee': Tabbar
        }
    })
</script>